

inherit "obj/object.c"

int isLoad = 0;

int load(){
    println("load了!!"+baseName(this));
    map obs = query("objects");
    if( !mapp(obs) ) return;
    string *k = keys(obs);
    foreach( p in k ){
        int n = obs[p];
        for(int i;i < n; i++){
            object obj  = new(p);
            obj.move(this);
        }
    }
}

//初始化出口数据,将连接更换为对象地址
int initExits(){

   map exits;

   if( mapp( exits = query("exits") ) ){

        string ks  = keys(exits);
        object r;
//        varDump(this,exits);
        foreach( p in ks ){

         if( strsrch(exits[p],"#") < 0 ){
            r = loadObject(exits[p]);
            exits[p] = r.query("file_addr");

         }





      //设置文件地址
       //new函数中已经设置了 对象的文件地址
      //e.set("file_addr",file+"#"+hashCode(e));

//            if(  ( r =  findObject(exits[p]) )  ){
//                exits[p] =
//            }
             println("initExits "+ r.query("file_addr"));
        }
   }
}


int reset(){



}